// 1. 当.then里面返回实例本身时，代码会报错。然后就会走reject
var promise1 = new Promise((resolve, reject) => {
  resolve(100)
});
var p1 = promise1.then((value) => {
  console.log(value)
  return p1
})
p1.then(value => console.log(value), reason => console.log(reason))
// p1.catch(reason=>{console.log(reason)})

// 2. then方法的参数可选,也就是参数不传递也能一次传递到后面。
var promise2 = new Promise((resolve, reject) => {
  resolve(100)
}); 
promise2
  .then(value => value)
  .then()
  .then(value => console.log(value))